<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js"></script>
	</head>
	<body>
		<fieldset id="app">

			<ul >
				<li v-for="item in aqiData">
					{{item[0]}}空气质量 {{item[1]}}
				</li>
			</ul>
			<button v-on:click="handleSort" type="button">从大到小排序</button>
		</fieldset>
		<script>
			var app = new Vue({
				el: '#app',
				data: {
					aqiData: [
						['北京', 100],
						['上海', 40],
						['福州', 10],
						['广州', 50],
						['成都', 60],
						['西安', 120],
					],
				},
				methods: {
					handleSort: function() {
						this.aqiData.sort(function(itemA, itemB) {
							return (itemB[1] - itemA[1]);
						})
						// console.log('你好')
					}
				}
			})
		</script>

	</body>
</html>
